<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Title</title>
  </head>
  <body>
    <div style='height: 300px; border: 1px solid red'>
      <div tabindex='10' style='width: 200px; height: 200px; border:1px solid blue'></div>
    </div>

    <script>
      console.log(document.hasFocus())

      document.querySelector('div').onclick = (event) => {
        const el = event.target
        console.log('el', el,  document.activeElement)
        console.dir(el)
        // console.log(event.target.hasFocus())

      }
    </script>
  </body>
</html>
